*"Dixie's Drivers: Core Values and the Southern Republican Realignment*

*This project analyzes the sources of partisan change among southerners*
*and non-southerners from 1988 to 2016*
*This project was conducted collaboratively with Seth C. McKee of Texas*
*Tech University*

*This Stata do file incorporates all of the analysis in the main file, plus*
*presidential and congressional vote choice variables*

*This Stata do file features code used to analyze the 2016 American National* 
*Election Study (ANES)*

*We will append this recoded dataset to our recoded ANES Cumulative File*
*dataset in order to create our analysis dataset*

*The code presented here is used to generate the empirical results shown*
*in the published Journal of Politics article's supplemental appendix*

*Note: The variables in this do file are named and coded identically*
*to their counterparts in the ANES Cumulative File*
*Our primary analysis Stata do file is entitled*
*"Southerners' Partisan Change, 1988-2016.do"*

*Thurs. 4 October 2018*
*Friday 5 October 2018*
*Mon. 8 October 2018*
*Friday 25 January 2019*

****************
*Executing this analysis first requires that the researcher download the 2016*
*ANES, which we have uploaded as a Stata 15 dataset entitled "2016 ANES.dta"*
****************

*Race*

gen White = .
replace White = 1 if V161310x == 1
keep if White == 1

*Gender*

gen Gender = V161342 
replace Gender = . if V161342 == -9
replace Gender = . if V161342 == 3
replace Gender = 0 if V161342  == 1
replace Gender = 1 if V161342  == 2

*Age*

gen Age =  V161267
replace Age = . if V161267 == -9
replace Age = . if V161267 == -8

*Education*

gen Education = V161270
replace Education = . if  V161270 == -9
replace Education = . if  V161270 == 90
replace Education = . if  V161270 == 95
replace Education = 0 if  V161270 > -9 & V161270 < 9
replace Education = 1 if  V161270 == 9
replace Education = 2 if  V161270 == 10
replace Education = 2 if  V161270 == 11
replace Education = 2 if  V161270 == 12
replace Education = 3 if  V161270 == 13
replace Education = 4 if  V161270 == 14
replace Education = 4 if  V161270 == 15
replace Education = 4 if  V161270 == 16

*Income*

gen Income = V161361x
replace Income = . if V161361x == -9
replace Income = . if V161361x == -5
replace Income = 1 if V161361x == 1
replace Income = 1 if V161361x == 2
replace Income = 1 if V161361x == 3
replace Income = 1 if V161361x == 4
replace Income = 2 if V161361x == 5
replace Income = 2 if V161361x == 6
replace Income = 2 if V161361x == 7
replace Income = 2 if V161361x == 8
replace Income = 3 if V161361x == 9
replace Income = 3 if V161361x == 10
replace Income = 3 if V161361x == 11
replace Income = 3 if V161361x == 12
replace Income = 3 if V161361x == 13
replace Income = 3 if V161361x == 14
replace Income = 3 if V161361x == 15
replace Income = 4 if V161361x == 16
replace Income = 4 if V161361x == 17
replace Income = 4 if V161361x == 18
replace Income = 4 if V161361x == 19
replace Income = 4 if V161361x == 20
replace Income = 4 if V161361x == 21
replace Income = 4 if V161361x == 22
replace Income = 4 if V161361x == 23
replace Income = 4 if V161361x == 24
replace Income = 4 if V161361x == 25
replace Income = 5 if V161361x == 26
replace Income = 5 if V161361x == 27
replace Income = 5 if V161361x == 28

****************
*Recode the region variable*

*Note: We recode the eleven states of the former Confederacy "by hand" for*
*the purpose of this analysis*
****************

*South*

gen South = 0
replace South = . if V161330 == 59
replace South = 1 if V161330 == 1
replace South = 1 if V161330 == 5
replace South = 1 if V161330 == 12
replace South = 1 if V161330 == 13
replace South = 1 if V161330 == 22
replace South = 1 if V161330 == 28
replace South = 1 if V161330 == 37
replace South = 1 if V161330 == 45
replace South = 1 if V161330 == 51
replace South = 1 if V161330 == 48
replace South = 1 if V161330 == 51

****************
*Recode symbolic predispositions*
****************

*Party identification*

*Note: Partisanship runs from "strong Democrat" (0)* 
*to "strong Republican" (6), with 3 representing true political independents*

gen Partyid = V161158x
replace Partyid = . if V161158x == -9
replace Partyid = . if V161158x == -8
replace Partyid = 0 if V161158x == 1
replace Partyid = 1 if V161158x == 2
replace Partyid = 2 if V161158x == 3
replace Partyid = 3 if V161158x == 4
replace Partyid = 4 if V161158x == 5
replace Partyid = 5 if V161158x == 6
replace Partyid = 6 if V161158x == 7

*Ideology*
*Note: Ideology runs from "extremely liberal" (0) to "extremely conservative"* 
*(6), with 3 representing ideological moderates*

gen Ideology = V162171
replace Ideology = . if V162171 == -9
replace Ideology = . if V162171 == -7
replace Ideology = . if V162171 == -6
replace Ideology = . if V162171 == 99
replace Ideology = 0 if V162171 == 1
replace Ideology = 1 if V162171 == 2
replace Ideology = 2 if V162171 == 3
replace Ideology = 3 if V162171 == 4
replace Ideology = 4 if V162171 == 5
replace Ideology = 5 if V162171 == 6
replace Ideology = 6 if V162171 == 7

*Recode ideology to range from "0" to "1"*

*Note: The variable is coded in this fashion so that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

replace Ideology = Ideology/6

****************
*Recode racial resentment variables*
****************

*Conditions have made it difficult for blacks to succeed*

gen Conditionsblack = V162212
replace Conditionsblack = . if V162212 == -9
replace Conditionsblack = . if V162212 == -8
replace Conditionsblack = . if V162212 == -7
replace Conditionsblack = . if V162212 == -6
replace Conditionsblack = 0 if V162212 == 1
replace Conditionsblack = 1 if V162212 == 2
replace Conditionsblack = 2 if V162212 == 3
replace Conditionsblack = 3 if V162212 == 4
replace Conditionsblack = 4 if V162212 == 5

*Blacks should get ahead without any special favors*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Blacksspecial = V162211
replace Blacksspecial = . if V162211 == -9
replace Blacksspecial = . if V162211 == -8
replace Blacksspecial = . if V162211 == -7
replace Blacksspecial = . if V162211 == -6
replace Blacksspecial = 0 if V162211 == 5
replace Blacksspecial = 1 if V162211 == 4
replace Blacksspecial = 2 if V162211 == 3
replace Blacksspecial = 3 if V162211 == 2
replace Blacksspecial = 4 if V162211 == 1

*Blacks could succeed if they would try harder*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Blackstry = V162214
replace Blackstry = . if V162214 == -9
replace Blackstry = . if V162214 == -8
replace Blackstry = . if V162214 == -7
replace Blackstry = . if V162214 == -6
replace Blackstry = 0 if V162214 == 5
replace Blackstry = 1 if V162214 == 4
replace Blackstry = 2 if V162214 == 3
replace Blackstry = 3 if V162214 == 2
replace Blackstry = 4 if V162214 == 1

*Blacks have gotten less than they deserve*

gen Blacksgotless = V162213
replace Blacksgotless = . if V162213 == -9
replace Blacksgotless = . if V162213 == -8
replace Blacksgotless = . if V162213 == -7
replace Blacksgotless = . if V162213 == -6
replace Blacksgotless = 0 if V162213 == 1
replace Blacksgotless = 1 if V162213 == 2
replace Blacksgotless = 2 if V162213 == 3
replace Blacksgotless = 3 if V162213 == 4
replace Blacksgotless = 4 if V162213 == 5

****************
*Recode retrospective economic evaluations variable*
*Note: This economic evaluation measure will be included as a control variable*
*in the model predicting partisanship*
****************

*Retrospective economic evaluations (one year)*

*Note: The unlabeled category is .5, which is unlabeled due to the fact that*
*STATA does not allow non-integer value labels*

*Note: The variable is coded in this fashion so that all primary predictors*
*of interest range from zero to one, allowing for a clear comparison* 
*of effects*

gen Retrospective = V161140
replace Retrospective = . if V161140 == -9
replace Retrospective = . if V161140 == -8
replace Retrospective = 0 if V161140 == 3
replace Retrospective = .5 if V161140 == 2
label var Retrospective ///
"Evaluation of the Economy over the Past Year"
label define Retrospectives ///
0 "0 Worse" 1 "1 Better"

****************
*Incorporate a religiosity variable into the model*
*Specifically, we follow Layman (1997) by creating a two-item scale of* 
*religiosity using the biblical literalism and frequency of church attendance*
*measures*
****************

*Biblical literalism*
*Note: This variable is reverse coded such that higher values indicate greater*
*greater religiosity*

gen Biblit = V161243
replace Biblit = . if V161243 == -9
replace Biblit = . if V161243 == -8
replace Biblit = . if V161243 == 5
replace Biblit = 0 if V161243 == 3
replace Biblit = 1 if V161243 == 2
replace Biblit = 2 if V161243 == 1
label var Biblit "Biblical Literalism"

*Note: The categories for the biblical literalism variable are as follows:*

*0 "The Bible is a book written by men and is not the word of God"
*1 "The Bible is the word of God but not everything in it should be taken literally, word for word"
*2 "The Bible is the actual word of God and is to be taken literally, word for word"

*Recode the biblical literalism variable to range between 0 and 1*

replace Biblit = Biblit/2

*Church attendance*
*Note: This variable is reverse coded such that higher values indicate greater*
*greater religiosity*

gen Churchattend = .
replace Churchattend = 0 if V161244 == 2
replace Churchattend = 0 if V161245 == 5
replace Churchattend = 1 if V161245 == 4
replace Churchattend = 2 if V161245 == 3
replace Churchattend = 3 if V161245 == 2
replace Churchattend = 4 if V161245 == 1
label var Churchattend "Church Attendance"

*Note: The categories for the church attendance variable are as follows*

*0 "Never"
*1 "A few times a year" 
*2 "Once or twice a month"
*3 "Almost every week" 
*4 "Every week"

*Recode the Church attendance variable to range between 0 and 1*

replace Churchattend = Churchattend/4

****************
*Recode values variables*

*Note: The eight individual questions comprising the two longest running ANES* 
*batteries of core values, egalitarianism (four questions) and moral* 
*traditionalism (four questions), will be combined into a single scale*
*ranging from zero to one in this analysis*

*Note: The resulting scale will serve as the primary independent variable* 
*of interest in the empirical analysis testing the potentially changing* 
*over time influence of region on the relationship* 
*between individuals' egalitarian postures and partisanship*
****************

****************
*Recode egalitarianism variables*

*Note: The equal opportunity, equal rights, less equal and unequal variables* 
*are all reverse coded so that higher values indicate* 
*more conservative values*
****************

*Do whatever is necessary for equal opportunity*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Equalopp = V162243
replace Equalopp = . if V162243 == -9
replace Equalopp = . if V162243 == -8
replace Equalopp = . if V162243 == -7
replace Equalopp = . if V162243 == -6
replace Equalopp = 0 if V162243 == 1
replace Equalopp = 1 if V162243 == 2
replace Equalopp = 2 if V162243 == 3
replace Equalopp = 3 if V162243 == 4
replace Equalopp = 4 if V162243 == 5

*Not that big of a problem if people have more of a chance*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Unequal = V162245
replace Unequal = . if V162245 == -9
replace Unequal = . if V162245 == -8
replace Unequal = . if V162245 == -7
replace Unequal = . if V162245 == -6
replace Unequal = 0 if V162245 == 5 
replace Unequal = 1 if V162245 == 4 
replace Unequal = 2 if V162245 == 3 
replace Unequal = 3 if V162245 == 2 
replace Unequal = 4 if V162245 == 1 

*Better off if we worried less about equality*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Lessequal = V162244
replace Lessequal = . if V162244 == -9
replace Lessequal = . if V162244 == -8
replace Lessequal = . if V162244 == -7
replace Lessequal = . if V162244 == -6
replace Lessequal = 0 if V162244 == 5
replace Lessequal = 1 if V162244 == 4
replace Lessequal = 2 if V162244 == 3
replace Lessequal = 3 if V162244 == 2
replace Lessequal = 4 if V162244 == 1

*Many fewer problems if people were treated more fairly*

gen Fewer = V162246
replace Fewer = . if V162246 == -9
replace Fewer = . if V162246 == -8
replace Fewer = . if V162246 == -7
replace Fewer = . if V162246 == -6
replace Fewer = 0 if V162246 == 1
replace Fewer = 1 if V162246 == 2
replace Fewer = 2 if V162246 == 3
replace Fewer = 3 if V162246 == 4
replace Fewer = 4 if V162246 == 5

****************
*Recode moral traditionalism variables*

*Note: The lifestyles and family variables are reverse coded so that higher* 
*values indicate more conservative values*
****************

*Newer lifestyles contributing to a breakdown in society*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*
 
gen Lifestyles = V162208
replace Lifestyles = . if V162208 == -9
replace Lifestyles = . if V162208 == -8
replace Lifestyles = . if V162208 == -7
replace Lifestyles = . if V162208 == -6
replace Lifestyles = 0 if V162208 == 5
replace Lifestyles = 1 if V162208 == 4
replace Lifestyles = 2 if V162208 == 3
replace Lifestyles = 3 if V162208 == 2
replace Lifestyles = 4 if V162208 == 1

*Adjusting views of moral behavior*

gen Changing = V162207
replace Changing = . if V162207 == -9
replace Changing = . if V162207 == -8
replace Changing = . if V162207 == -7
replace Changing = . if V162207 == -6
replace Changing = 0 if V162207 == 1
replace Changing = 1 if V162207 == 2
replace Changing = 2 if V162207 == 3
replace Changing = 3 if V162207 == 4
replace Changing = 4 if V162207 == 5

*More emphasis on traditional family ties*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*
 
gen Family = V162210
replace Family = . if V162210 == -9
replace Family = . if V162210 == -8
replace Family = . if V162210 == -7
replace Family = . if V162210 == -6
replace Family = 0 if V162210 == 5
replace Family = 1 if V162210 == 4
replace Family = 2 if V162210 == 3
replace Family = 3 if V162210 == 2
replace Family = 4 if V162210 == 1

*Tolerant of people who choose to live according to their own moral standards*

gen Standards = V162209
replace Standards = . if V162209 == -9
replace Standards = . if V162209 == -8
replace Standards = . if V162209 == -7
replace Standards = . if V162209 == -6
replace Standards = 0 if V162209 == 1
replace Standards = 1 if V162209 == 2
replace Standards = 2 if V162209 == 3
replace Standards = 3 if V162209 == 4
replace Standards = 4 if V162209 == 5

****************
*Create behavioral dependent variables, namely, presidential and congressional* 
*vote choice*
****************

*Presidential vote choice*

gen Presvote = .
replace Presvote = 0 if V162034a == 1
replace Presvote = 1 if V162034a == 2

*Congressional (House) vote choice*

gen Housevote = .
replace Housevote = 0 if V162040 == 1
replace Housevote = 1 if V162040 == 2

****************
keep version V160001 White-Housevote
****************
